﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Proggy.Web.Cms.PropertyTypes;
using Proggy.Web.Cms.Core.Models;

namespace Proggy.Web.Cms.Core.Configuration.ConfigObjects
{
    /// <summary>
    /// Config object
    /// </summary>
    public class CharLimitedTextStringConfigObject : PropertyTypeConfigObjectBase
    {
        /// <summary>
        /// If true, is multiline text box (default = false)
        /// </summary>
        public bool Multiline { get; set; }

        /// <summary>
        /// Character limit (0 = default = no limit)
        /// </summary>
        public int Limit { get; set; }

        /// <summary>
        /// Characters which are not allowed (default = none)
        /// </summary>
        public char[] ExcludedCharacters
        {
            get { return this._excludedCharacters; }
            set { this._excludedCharacters = value; }
        }
        private char[] _excludedCharacters = new char[] { };

        /// <summary>
        /// Regex match pattern (default = none)
        /// </summary>
        public List<RegexMatchPatternAndErrorMessage> RegexMatchPatterns {
            get { return this._regexMatchPatterns; }
            set { this._regexMatchPatterns = value; }
        }
        private List<RegexMatchPatternAndErrorMessage> _regexMatchPatterns = new List<RegexMatchPatternAndErrorMessage>();


        /// <summary>
        /// Minimum characters to be entered (0 = default)
        /// </summary>
        public int Minimum { get; set; }
    }
}
